package com.aizhixin.lab.project.course.entity;

import com.aizhixin.lab.project.template.entity.ProjectRole;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Data
@Entity(name = "c_task_work_order")
public class TeacherTaskWorkOrder {
    @Id
    private String id;
    @Column(name = "task_id")
    private String taskId;
    @Column(name = "w_name")
    private String workOrderName;
    @Column(name = "w_desc")
    private String workOrderDesc;
    @Column(name = "w_video")
    private String workOrderVideo;
    @Column(name = "suggest_time")
    private Float suggestTime;
    @Column(name = "created_by")
    private Long createdBy;
    @Column(name = "created_date",insertable = false)
    private Date createdDate;
    @Column(name = "delete_flag",insertable = false)
    private Integer deleteFlag;
    @Column(name = "work_order_no")
    private Integer workOrderNo;
    @Column(name = "work_step_url")
    private String workStepUrl;
    @Column(name = "work_step_name")
    private String workStepName;
    @ManyToMany(fetch = FetchType.EAGER)
    @JsonIgnoreProperties(value = { "teacherTaskWorkOrderList" })
    @JoinTable(name = "c_work_order_and_role",
            joinColumns = @JoinColumn(name = "work_order_id",referencedColumnName = "id"),
            inverseJoinColumns = @JoinColumn(name = "role_id",referencedColumnName = "id"))
    private List<ProjectRole> projectRoleList;
    @Column(name = "work_order_level")
    private Integer workOrderLevel;
}
